{% extends "baseLog.html" %}
{% block body %}
    {% if 'username' in session %}
	<div class="navbar navbar-inverse navbar-fixed-top">
      <div class="navbar-inner">
        <div class="container">
          <button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="brand" href="#">Project Manager System</a>
          <div class="nav-collapse collapse">
            <ul class="nav">
              <li><a href="/admproyecto/">Administrar proyecto</a></li>
              <li><a href="#contact">Contact</a></li>
              </ul>
          </div>
         </div>
        </div>
        <div class="container">
        <br/>
        <div class="hero-unit">
        <h1>PMS</h1>
        <h2>Logout </h2>
        <strong>Usuario:</strong> {{session['username']}}
        <br></br>
        <form action="{{url_for('index')}}" method="post">
            <p><input class="btn btn-large btn-danger" type="submit" name="logout" value="logout" />
            <a class="btn btn-large btn-inverse" href="/admproyecto/">Cancelar</a></p>
        </form>
        </div>
 	</div>	
	</div>
	
    {% else %}
    <div class="navbar navbar-inverse navbar-fixed-top">
      <div class="navbar-inner">
        <div class="container">
          <button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
            <span class="icon-bar"></span>
          </button>
          <a class="brand" href="#">Project Manager System</a>
          <div class="nav-collapse collapse">
            <ul class="nav">
              <li><a href="#contact">Contact</a></li>
              </ul>
          </div>
         </div>
        </div>
     <div class="container">
     <br>
     <div class="hero-unit">
     	<h1>Bienvenido!</h1>
     	<p class="text-info">PMS es una aplicación web con la que puedes gestionar tus proyectos de manera organizada y eficiente.</p>
        <h2>Login</h2>
        <p></p>
        <form action="{{url_for('index')}}" method="post">
            <p>Nombre de usuario:
             {%  with messages = get_flashed_messages(category_filter=["usuario"]) %}
		  			{% if messages %}
		  				{% for message in messages %}
	   						<small class="text-error">{{ message }}</small>	
	   					{% endfor %}    					
					{% endif %}
				{% endwith %}
            <br />
            <input type="text" name="username" value="{{session['aux1']}}" /></p>
            <p>Clave:
             {%  with messages = get_flashed_messages(category_filter=["clave"]) %}
		  			{% if messages %}
		  				{% for message in messages %}
	   						<small class="text-error">{{ message }}</small>	
	   					{% endfor %}    					
					{% endif %}
				{% endwith %}
            <br />
            <input type="password" name="passwd" /></p>
             {%  with messages = get_flashed_messages(category_filter=["incorrecto"]) %}
		  			{% if messages %}
		  				{% for message in messages %}
	   						<small class="text-error">{{ message }}</small>	
	   					{% endfor %}    					
					{% endif %}
				{% endwith %}
            <p><input class="btn btn-large btn-success" type="submit" value="Login" /></p>
        </form>
        
    {% endif %}
     </div>
     </div>
    </div>
{% endblock %}
